From 55742b2c955bc25e5e7d37d783950521c8a730c4 Mon Sep 17 00:00:00 2001 From: Stevan Earl Date: Wed, 5 Aug 2026 16:23:33 -0700 Subject: [PATCH] fix: corrected trigger diagnostic in roles.m4 including the incorrect displayed date (cherry picked from commit fcfaccadf080504ce6013a8e8f1af879128be754) --- db/schemas/lib/triggers/create/roles.m4 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/db/schemas/lib/triggers/create/roles.m4 b/db/schemas/lib/triggers/create/roles.m4 index e3393f9..5f1a6ad 100644 --- a/db/schemas/lib/triggers/create/roles.m4 +++ b/db/schemas/lib/triggers/create/roles.m4 @@ -176,7 +176,7 @@ CREATE OR REPLACE FUNCTION roles_func () END IF; -- The follow cannot be after the participant's departdate. - SELECT biography_data.entrydate + SELECT biography_data.departdate , watches.animid, watches.date, watches.type INTO a_departdate , a_animid , a_date , a_type @@ -189,10 +189,12 @@ CREATE OR REPLACE FUNCTION roles_func () IF FOUND THEN RAISE EXCEPTION integrity_constraint_violation USING MESSAGE = 'Error on ' || TG_OP || ' of ROLES' - , DETAIL = 'An individual cannot particpate in a follow after' + , DETAIL = 'An individual cannot participate in a follow after' || ' their departure from the study' || ' (after BIOGRAPHY_DATA.DepartDate)' - || ' event with a EVENTS.Behavior of (sdb_arrival):' + || ' event with an EVENTS.Behavior of (' + || a_behavior + || '):' || ': Key (PID) = (' || NEW.pid || '), Value (EID) = (' -- 2.34.1